<script>
import {
  DesignConfiguration,
  Main
} from "./components"
import adapter from "./utils/handlePlatform/adapter.js";

export default {
  name: "App",
  components: { DesignConfiguration, Main },
  props: {
    vueProps: Object
  },
  data() {
    return {
      newProps:this.vueProps
    }
  },
  computed: {},
  watch: {},
  created() {
  },
  mounted() {
    this.vueProps.eventBus.on((newProps) => {
      this.newProps = adapter(newProps)
    })
  },
  beforeDestroy() {
  },
  methods: {},
  render(h) {
    const renderhMap = {
      main: Main,
      designConfiguration: DesignConfiguration
    }
    const Comp = renderhMap[this.vueProps.type]
    return <Comp vueProps={this.newProps} />
  }
}
</script>
